import java.math.BigInteger;

public class Leet80_01 {
    public static void main(String[] args) {
        System.out.println(waysToStep(100000));
    }
    static public String waysToStep(int n) {
        if(n==1)
            return "1";
        if(n==2)
            return "2";
        if(n==3)
            return "3";
        BigInteger[] dp = new BigInteger[n];
        dp[0] = new BigInteger("1");
        dp[1] = new BigInteger("2");
        dp[2] = new BigInteger("4");
        for (int i = 3; i < n; i++)
            dp[i] = dp[i-1].add(dp[i-2]).add(dp[i-3]);
        return dp[n-1].toString();
    }
}
